(function() {
	require(['jquery', 'navigation'], function(jquery, navigation) {
		var newResource = $('#main_left').data('resource') || null;
		if(newResource == null) {
			return;
		}
		var opts = {
				type: 'TITLE',
				position: 'TOP',
				field: {title: 'name', icon: 'icontext', url: 'url'},
				data: newResource,
				selected: '1',
				onSelect: function(item) {
					var url = item.url, selector = '#subContent', main_center ='content';
					if($('#content')) {
						$('#content').empty();
					}
					orange.loadPage({url: url, target: main_center, selector: selector, success: function(response) {
						console.log('页面' + item.title +'加载成功');
					}});
				},
				onLoaded: function() {
					console.log('navigation组件创建完成');
				}
			};
		var org_nav = navigation.create('#contentNav', opts);
		window.org_nav = org_nav;
	});
})();